home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
develop
/
libsrc11.arc
/
RDBYTSCI.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-04-27
|
1KB
|
42 lines
/* rdbytsci.c 4.3 */
/*F****************************************************************************
FUNCTION NAME: rdbytsci
ACTION: Reads a character from the SCI serial hardware.
Returns an integer containing status and data.
The upper byte of the integer returned is composed
of the SCI status register and the 9th data bit.
The low byte returned is the low 8 bits of the data
read.
PARAMETERS: (None)
RETURNS: (unsigned) BigByte: bits 15-9 = 68HC11 SCSR register
bit 8 = 9th data bit (if sent)
bits 7-0 = data byte
******************************************************************************/
#define NINTH_BIT 0x100 /* Ninth data bit */
#include <hc11/io.h>
#include <hc11/sci.h>
#include <hc11/directives.h>
SMALL
unsigned rdbytsci()
{
while ((HC11.SCSRDAT.STATUS&RDRF) == 0)
; /* Null Statement */
if (HC11.SCCR1 & R8)
return(HC11.SCSRDAT.STATDATA | NINTH_BIT);
else
return(HC11.SCSRDAT.STATDATA);
} /* end of rdbytsci */